<?php
class Rzd_Validate_UserPassword extends Zend_Validate_Abstract
{
    protected $_requiredFields;

    const FIELD_IS_NOT_CORRECT = 'FieldsIsNotCorrect';

    protected $_messageTemplates = array(
        self::FIELD_IS_NOT_CORRECT => "The password
            should contain Latin letters and figure. Minimum length of password of 8 symbols "
    );

    public function __construct(){}

    public function isValid($value)
    {
       $isValid = true;
       if($value) {
           if(!(preg_match('/^[a-zA-Z0-9]{8,}$/', $value))) {
               $this->_error(self::FIELD_IS_NOT_CORRECT);
               $isValid = false;
           }
       }

       return $isValid;
    }
}